from golang:1.14.7 as builder
run git config --global http.sslVerify false \
  && go env -w GO111MODULE=on \
  &&  go env -w GOPROXY=https://goproxy.cn,direct
#run  go get github.com/beego/bee \
# && go get github.com/go-sql-driver/mysql \
# && go get github.com/dgrijalva/jwt-go \
# && go get github.com/phinexdaz/ipapk \
# && go get github.com/satori/go.uuid \
# && go get github.com/astaxie/beego

workdir /app
#copy go.mod go.sum ./
#run go mod download
add . .
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -ldflags="-s -w" -installsuffix cgo -o main main.go

from ruby:2.6.1
#from scratch
run mkdir /msg
#copy --from=builder /app/main /
#copy --from=builder /app/conf ./conf
copy --from=builder /app /
run gem install fir-cli
CMD ["/main"]

